package com.itheima.restkeeper.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.restkeeper.pojo.PaySetting;
import com.itheima.restkeeper.pojo.Payconfig;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description：Mapper接口
 */
public interface PayconfigMapper extends BaseMapper<Payconfig> {


    @Select("SELECT tpc.id,tpc.type,tpc.`pay_key`,tpcv.`pay_value`,tpcv.enterprise_id,tpcv.enable_flag,tpcv.created_time,tpcv.updated_time,tpcv.sharding_id FROM tab_payconfig tpc LEFT JOIN tab_payconfigvalue tpcv ON tpc.id = tpcv.payconfig_id WHERE tpcv.enterprise_id = #{enterpriseId} AND tpcv.enable_flag = 'YES' AND tpc.type = #{type}")
    public List<PaySetting> queryAllPayconfig(@Param("enterpriseId") Long enterpriseId, @Param("type") Integer type);

}
